<%--
  Created by IntelliJ IDEA.
  User: jie
  Date: 2020/8/20
  Time: 10:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <title>商品列表</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/toastr/toastr.min.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/shop/css/shopManage.css"/>
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/static/toastr/toastr.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<form role="form" class="form-inline">
    <div class="form-group" style="margin-left: 25px;">
        <label>商品编号</label>
        <input id="shopId" type="text" class="catgid form-control"/>
    </div>
    <div class="form-group">
        <label>商品名称</label>
        <input id="shopName" type="text" class="form-control"/>
    </div>
    <button type="button" onclick="findPage(1,pageBean.pageSize)" class="btn btn-primary btn-sm">搜索</button>
</form>

<table class="table table-bordered text-center table-responsive table-striped table-hover">

    <thead class="text-center">
    <tr>
        <th>商品编号</th>
        <th>商品名称</th>
        <th>商品数量</th>
        <th>状态</th>
        <th>商品类型</th>
        <th>单位</th>
        <th>价格</th>
        <th>操作</th>
    </tr>
    </thead>

    <tbody id="tb"></tbody>
</table>


<div class="row" id="navBar">
    显示第<span id="start"></span>到第<span id="end"></span>条，总共<span id="sum"></span>条记录，每页显示
    <div class="btn-group dropup">
        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span id="count"></span>&nbsp;&nbsp;<span
                class="caret"></span></button>
        <ul class="dropdown-menu" role="menu">
            <li><a href="javascript:findPage(1,5)">5</a></li>
            <li><a href="javascript:findPage(1,10)">10</a></li>
            <li><a href="javascript:findPage(1,50)">50</a></li>
            <li><a href="javascript:findPage(1,100)">100</a></li>
        </ul>
    </div>
    条记录
    <div class="pull-right">
        <nav aria-label="Page navigation">
            <ul id="ctn" class="pagination"></ul>
        </nav>
    </div>
</div>


<!-- 修改商品模态框 -->
<form id="modifyShop" method="post">
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel1">修改商品信息</h4>
                </div>
                <div class="row">
                    <div class="modal-body">
                        <div class="verification col-md-4">
                            <div class="input-group">
                                <span class="input-group-addon">商品名称</span>
                                <input hidden name="id"><%--用来存id--%>
                                <input type="text" name="name" class="form-control"/>
                                <span class="glyphicon" aria-hidden="true"></span>
                            </div>
                        </div>
                        <div class="verification col-md-4">
                            <div class="input-group">
                                <span class="input-group-addon">数量</span>
                                <input type="text" name="code" class="form-control"/>
                                <span class="glyphicon" aria-hidden="true"></span>
                            </div>
                        </div>
                        <div class="verification col-md-4">
                            <div class="input-group">
                                <span class="input-group-addon">单位</span>
                                <select name="unitId" class="unit form-control">
                                    <c:forEach items="${unitList}" var="unit">
                                        <c:if test="${unit.status==1}">
                                            <option value="${unit.id}">${unit.name}</option>
                                        </c:if>
                                    </c:forEach>
                                </select>
                                <span class="glyphicon" aria-hidden="true"></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="modal-body">
                        <div class="verification col-md-4">
                            <div class="input-group">
                                <span class="input-group-addon">商品类型</span>
                                <select name="type" class="unit form-control">
                                    <option value="1">普通商品</option>
                                    <option value="0">服务商品</option>
                                </select>
                                <span class="glyphicon" aria-hidden="true"></span>
                            </div>
                        </div>
                        <div class="verification col-md-4">
                            <div class="input-group">
                                <span class="input-group-addon">价格</span>
                                <input name="price" type="text" class="form-control"/>
                                <span class="glyphicon" aria-hidden="true"></span>
                            </div>
                        </div>
                        <div class="verification col-md-4">
                            <div class="input-group">
                                <span class="input-group-addon">类别</span>
                                <select name="categoryId" class="unit form-control">
                                    <c:forEach items="${cgs}" var="cg">
                                        <c:if test="${cg.status==1}">
                                            <option value="${cg.id}">${cg.name}</option>
                                        </c:if>
                                    </c:forEach>
                                </select>
                                <span class="glyphicon" aria-hidden="true"></span>
                                <input hidden name="goodsId">
                                <input hidden name="status">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-body">
                </div>
                <div class="modal-footer">
                    <button type="button" id="cancel" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" id="confirm" class="btn btn-primary" data-dismiss="modal">确认</button>
                </div>
            </div>
        </div>
    </div>
</form>
<!-- 修改商品模态框 -->

<!-- 商品上下架提示 -->
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h5 class="modal-title" id="myModalLabel">操作提示</h5>
            </div>
            <div class="modal-body">
                确认当前操作
            </div>
            <div id="opinfo" class=" modal-footer">
                <button type="button" class="confirm btn btn-primary btn-success" data-dismiss="modal">确认</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!-- 商品上下架提示 -->
<script src="${pageContext.request.contextPath}/shop/js/shopManage.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>

